package com.forezp.configclient.rabbitConfig;

import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.support.CorrelationData;

/**
 * @version V1.0  </br>
 * @ClassName MessageCorrelationData </br>
 * @Description 重写 CorrelationData, 添加exchange(转发器), routingKey(路由键), message(发送的消息)  </br>
 * @Author tonywang</br>
 * @DATE 11/22/2018 3:29 PM</br>
 */
public class MessageCorrelationData extends CorrelationData {
    private String exchange;
    private String routingKey ;
    private Message message ;

    public MessageCorrelationData(){
        super();
    }

    public MessageCorrelationData(String exchange, String routingKey, Message message) {
        this.exchange = exchange;
        this.routingKey = routingKey;
        this.message = message;
    }

    public MessageCorrelationData(String id, String exchange, String routingKey, Message message) {
        super(id);
        this.exchange = exchange;
        this.routingKey = routingKey;
        this.message = message;
    }

    public String getExchange() {
        return exchange;
    }

    public MessageCorrelationData setExchange(String exchange) {
        this.exchange = exchange;
        return this;
    }

    public String getRoutingKey() {
        return routingKey;
    }

    public MessageCorrelationData setRoutingKey(String routingKey) {
        this.routingKey = routingKey;
        return this;
    }

    public Message getMessage() {
        return message;
    }

    public MessageCorrelationData setMessage(Message message) {
        this.message = message;
        return this;
    }
}
